<template>
  <div class="app-container">

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini"
                   @click="handleAdd" v-hasPermi="['lease:bpMaster:add']">新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
                   @click="handleUpdate" v-hasPermi="['lease:bpMaster:edit']">修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
                   @click="handleDelete" v-hasPermi="['lease:bpMaster:remove']">删除
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="warning" plain icon="el-icon-download" size="mini"
                   @click="handleExport" v-hasPermi="['lease:bpMaster:export']">导出
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-tabs type="border-card">
      <el-tab-pane label="基本信息" name="first">
        <el-form ref="form" :model="form.bpMaster" :rules="rules" label-width="140px" size="small">
          <el-divider content-position="left">基本信息</el-divider>
          <el-row>
            <el-col :span="12">
<!--              <el-form-item label="商业伙伴名称" prop="bpName" label-width="120px">
                <el-input v-model="form.bpMaster.bpName" placeholder="请输入商业伙伴名称" clearable style="width: 90%"/>
              </el-form-item>-->
            </el-col>
            <el-col :span="6">
              <el-form-item label="商业伙伴分类" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpMaster.bpClass" placeholder="请输入商业伙伴分类" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="商业伙伴编码" prop="bpCode" label-width="120px">
                <el-input v-model="form.bpMaster.bpCode" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="是否集团内部" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpMaster.bpClass" placeholder="请输入是否集团内部" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="利润中心" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入利润中心" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="行业" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入行业" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="国家" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入国家" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="公司性质" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入公司性质" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="实际控制人类型" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入实际控制人类型" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="实际控制人" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入实际控制人" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="实际控制人组织机构代码" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入实际控制人组织机构代码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="实际控制人证件类型" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入实际控制人证件类型" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="实际控制人证件号码" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入实际控制人证件号码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="法定代表人" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入法定代表人" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="币种" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入币种" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="营业执照号" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="营业执照号是否为长期" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="注册时间" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="营业执照到期日" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="注册资本(万元)" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="实际资本(万元)" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="外部信用评级" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="评级时间" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="是否上市公司" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="上市主体" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="上市主体组织机构代码" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="启用" prop="enabledFlag" label-width="120px">
                <el-select v-model="form.enabledFlag" placeholder="请选择启用标志" clearable>
                  <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label" :value="dict.value"/>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="上市地点" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="企业人数" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="销售额" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="备注" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-divider content-position="left">地址信息</el-divider>
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddBpMasterAddress">添加</el-button>
            </el-col>
            <el-col :span="1.5">
              <el-button type="danger" plain icon="el-icon-delete" size="mini" @click="handleDeleteBpMasterAddress">删除
              </el-button>
            </el-col>
          </el-row>
          <el-table :data="bpMasterAddressList" :row-class-name="rowInvPurchaseRollOutIndex"
                    @selection-change="handleInvPurchaseRollOutSelectionChange" ref="invPurchaseRollOut">
            <el-table-column type="selection" width="50" align="center"/>
            <el-table-column label="序号" align="center" prop="index" width="50"/>
            <el-table-column label="地址类型" prop="rollOutAccountIdN" width="150">
              <template slot-scope="scope">
                <el-input v-model="scope.row.rollOutAccountId" placeholder="转出账户"/>
              </template>
            </el-table-column>
            <el-table-column label="国家" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="省份" align="center" prop="bankAccountNum" min-width="150px"/>
            <el-table-column label="市" prop="rollOutAmount" width="150">
              <template slot-scope="scope">
                <el-input v-model="scope.row.rollOutAmount" placeholder="请输入转出金额"/>
              </template>
            </el-table-column>
            <el-table-column label="区/县" prop="rollInAmount" width="150">
              <template slot-scope="scope">
                <el-input v-model="scope.row.rollInAmount" placeholder="请输入内扣申购费用"/>
              </template>
            </el-table-column>
            <el-table-column label="详细地址" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="邮编" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="电话" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="传真" align="center" prop="bankName" min-width="150px"/>
          </el-table>
          <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
                      @pagination="getInvPurchaseRollOutList"/>

          <el-divider content-position="left">联系人信息</el-divider>
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddBpMasterAddress">添加</el-button>
            </el-col>
            <el-col :span="1.5">
              <el-button type="danger" plain icon="el-icon-delete" size="mini" @click="handleDeleteBpMasterAddress">删除
              </el-button>
            </el-col>
          </el-row>
          <el-table :data="bpMasterAddressList" :row-class-name="rowInvPurchaseRollOutIndex"
                    @selection-change="handleInvPurchaseRollOutSelectionChange" ref="invPurchaseRollOut">
            <el-table-column type="selection" width="50" align="center"/>
            <el-table-column label="序号" align="center" prop="index" width="50"/>
            <el-table-column label="催收联系人" prop="rollOutAccountIdN" width="150">
              <template slot-scope="scope">
                <el-input v-model="scope.row.rollOutAccountId" placeholder="转出账户"/>
              </template>
            </el-table-column>
            <el-table-column label="联系人" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="职务" align="center" prop="bankAccountNum" min-width="150px"/>
            <el-table-column label="证件类型" prop="rollOutAmount" width="150">
              <template slot-scope="scope">
                <el-input v-model="scope.row.rollOutAmount" placeholder="请输入转出金额"/>
              </template>
            </el-table-column>
            <el-table-column label="证件号码" prop="rollInAmount" width="150">
              <template slot-scope="scope">
                <el-input v-model="scope.row.rollInAmount" placeholder="请输入内扣申购费用"/>
              </template>
            </el-table-column>
            <el-table-column label="手机" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="传真" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="邮箱" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="电话" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="家庭住址" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="是否发送短信" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="备注" align="center" prop="bankName" min-width="150px"/>
          </el-table>
          <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
                      @pagination="getInvPurchaseRollOutList"/>

          <el-divider content-position="left">股东信息</el-divider>
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddBpMasterAddress">添加</el-button>
            </el-col>
            <el-col :span="1.5">
              <el-button type="danger" plain icon="el-icon-delete" size="mini" @click="handleDeleteBpMasterAddress">删除
              </el-button>
            </el-col>
          </el-row>
          <el-table :data="bpMasterAddressList" :row-class-name="rowInvPurchaseRollOutIndex"
                    @selection-change="handleInvPurchaseRollOutSelectionChange" ref="invPurchaseRollOut">
            <el-table-column type="selection" width="50" align="center"/>
            <el-table-column label="序号" align="center" prop="index" width="50"/>
            <el-table-column label="股东类型" prop="rollOutAccountIdN" width="150">
              <template slot-scope="scope">
                <el-input v-model="scope.row.rollOutAccountId" placeholder="转出账户"/>
              </template>
            </el-table-column>
            <el-table-column label="股东名称" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="证件(登记)类型" align="center" prop="bankAccountNum" min-width="150px"/>
            <el-table-column label="证件(登记)号码" prop="rollOutAmount" width="150">
              <template slot-scope="scope">
                <el-input v-model="scope.row.rollOutAmount" placeholder="请输入转出金额"/>
              </template>
            </el-table-column>
            <el-table-column label="组织机构代码" prop="rollInAmount" width="150">
              <template slot-scope="scope">
                <el-input v-model="scope.row.rollInAmount" placeholder="请输入内扣申购费用"/>
              </template>
            </el-table-column>
            <el-table-column label="机构信用代码" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="出资额(万)" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="出资占比" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="实际任职" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="与实际控制人关系" align="center" prop="bankName" min-width="150px"/>
          </el-table>
          <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
                      @pagination="getInvPurchaseRollOutList"/>
          <el-divider content-position="left">伙伴关系</el-divider>
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddBpMasterAddress">添加</el-button>
            </el-col>
            <el-col :span="1.5">
              <el-button type="danger" plain icon="el-icon-delete" size="mini" @click="handleDeleteBpMasterAddress">删除
              </el-button>
            </el-col>
          </el-row>
          <el-table :data="bpMasterAddressList" :row-class-name="rowInvPurchaseRollOutIndex"
                    @selection-change="handleInvPurchaseRollOutSelectionChange" ref="invPurchaseRollOut">
            <el-table-column type="selection" width="50" align="center"/>
            <el-table-column label="序号" align="center" prop="index" width="50"/>
            <el-table-column label="关系类型" prop="rollOutAccountIdN" width="150">
              <template slot-scope="scope">
                <el-input v-model="scope.row.rollOutAccountId" placeholder="转出账户"/>
              </template>
            </el-table-column>
            <el-table-column label="相关伙伴ID" align="center" prop="bankName" min-width="150px"/>
            <el-table-column label="启用" align="center" prop="bankAccountNum" min-width="150px"/>
          </el-table>
          <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
                      @pagination="getInvPurchaseRollOutList"/>
          <el-divider content-position="left">征信信息</el-divider>
          <el-row>
            <el-col :span="6">
              <el-form-item label="是否上市公司" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="上市主体" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="上市主体组织机构代码" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="启用" prop="enabledFlag" label-width="120px">
                <el-select v-model="form.enabledFlag" placeholder="请选择启用标志" clearable>
                  <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label" :value="dict.value"/>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-divider content-position="left">基础数据项补充</el-divider>
          <el-divider content-position="left">基础属性段数据项补充</el-divider>
          <el-divider content-position="left">机构状态段数据项补充</el-divider>
          <el-divider content-position="left">主要关联企业</el-divider>
          <el-divider content-position="left">上级(主管)单位</el-divider>
          <el-divider content-position="left">诉讼信息</el-divider>
          <el-divider content-position="left">其他重大信息</el-divider>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="开票信息" name="second">
        <el-divider content-position="left">开票信息</el-divider>
        <el-form ref="form" :model="form" :rules="rules" label-width="140px" size="small">
          <el-row>
            <el-col :span="6">
              <el-form-item label="纳税人类型" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入纳税人类型" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="纳税人识别号" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入纳税人识别号" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="应收发票种类" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入应收发票种类" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="发票抬头" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入发票抬头" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="发票地址及电话" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="发票开户行及账号" prop="bpClass" label-width="120px">
                <el-input v-model="form.bpClass" placeholder="请输入商业伙伴编码" clearable style="width: 90%"/>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="角色信息" name="third">
        <el-divider content-position="left">角色信息</el-divider>
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddBpMasterAddress">添加</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="danger" plain icon="el-icon-delete" size="mini" @click="handleDeleteBpMasterAddress">删除
            </el-button>
          </el-col>
        </el-row>
        <el-table :data="bpMasterAddressList" :row-class-name="rowInvPurchaseRollOutIndex"
                  @selection-change="handleInvPurchaseRollOutSelectionChange" ref="invPurchaseRollOut" height="300px">
          <el-table-column type="selection" width="50" align="center"/>
          <el-table-column label="序号" align="center" prop="index" width="50"/>
          <el-table-column label="商业伙伴类别" prop="rollOutAccountIdN" width="150">
            <template slot-scope="scope">
              <el-input v-model="scope.row.rollOutAccountId" placeholder="转出账户"/>
            </template>
          </el-table-column>
          <el-table-column label="商业伙伴类型" align="center" prop="bankName" min-width="150px"/>
          <el-table-column label="主角色标志" align="center" prop="bankAccountNum" min-width="150px"/>
          <el-table-column label="启用" prop="rollOutAmount" width="150">
            <template slot-scope="scope">
              <el-input v-model="scope.row.rollOutAmount" placeholder="请输入转出金额"/>
            </template>
          </el-table-column>
        </el-table>
        <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
                    @pagination="getInvPurchaseRollOutList"/>
      </el-tab-pane>
      <el-tab-pane label="银行账户" name="fourth">
        <el-divider content-position="left">银行账户</el-divider>
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddBpMasterAddress">添加</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="danger" plain icon="el-icon-delete" size="mini" @click="handleDeleteBpMasterAddress">删除
            </el-button>
          </el-col>
        </el-row>
        <el-table :data="bpMasterAddressList" :row-class-name="rowInvPurchaseRollOutIndex"
                  @selection-change="handleInvPurchaseRollOutSelectionChange" ref="invPurchaseRollOut" height="300px">
          <el-table-column type="selection" width="50" align="center"/>
          <el-table-column label="序号" align="center" prop="index" width="50"/>
          <el-table-column label="账户编码" prop="rollOutAccountIdN" width="150">
            <template slot-scope="scope">
              <el-input v-model="scope.row.rollOutAccountId" placeholder="转出账户"/>
            </template>
          </el-table-column>
          <el-table-column label="账户名称" align="center" prop="bankName" min-width="150px"/>
          <el-table-column label="银行账户" align="center" prop="bankAccountNum" min-width="150px"/>
          <el-table-column label="账户全称" prop="rollOutAmount" width="150">
            <template slot-scope="scope">
              <el-input v-model="scope.row.rollOutAmount" placeholder="请输入转出金额"/>
            </template>
          </el-table-column>
          <el-table-column label="分行名称" prop="rollInAmount" width="150">
            <template slot-scope="scope">
              <el-input v-model="scope.row.rollInAmount" placeholder="请输入内扣申购费用"/>
            </template>
          </el-table-column>
          <el-table-column label="国家" align="center" prop="bankName" min-width="150px"/>
          <el-table-column label="省份" align="center" prop="bankName" min-width="150px"/>
          <el-table-column label="市" align="center" prop="bankName" min-width="150px"/>
          <el-table-column label="区/县" align="center" prop="bankName" min-width="150px"/>
          <el-table-column label="启用" align="center" prop="bankName" min-width="150px"/>
        </el-table>
        <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
                    @pagination="getInvPurchaseRollOutList"/>
      </el-tab-pane>
      <el-tab-pane label="附件信息" name="fiveth">
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import {listBpMaster, getBpMaster, delBpMaster, addBpMaster, updateBpMaster} from "@/api/lease/bpMaster";
import {listBpMasterAddress,getBpMasterAddress,delBpMasterAddress,addBpMasterAddress,updateBpMasterAddress} from "@/api/lease/bpMasterAddress";
import { listBpMasterBankAccount, getBpMasterBankAccount, delBpMasterBankAccount, addBpMasterBankAccount, updateBpMasterBankAccount } from "@/api/lease/bpMasterBankAccount";

export default {
  name: "BpMasterDetail",
  dicts: ['sys_yes_no'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 商业伙伴信息表格数据
      bpMasterList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        ownerUserId: null,
        bpCode: null,
        bpName: null,
        extraNam: null,
        bpClass: null,
        bpCategory: null,
        bpType: null,
        enabledFlag: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        bpCode: [
          {required: true, message: "商业伙伴编码不能为空", trigger: "blur"}
        ],
      },
      allData: {}
    };
  },
  created() {
    const bpId = this.$route.query&&this.$route.query.bpId;
    this.queryParams.bpId = bpId;
    this.getAllData();
  },
  methods: {
    /** 查询商业伙伴 */
    getAllData() {
      this.loading = true;
      this.getBpMaster1();
      this.getBpMasterAddressList();
      listBpMaster(this.queryParams).then(response => {
        this.bpMasterList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    getBpMaster1(){
      getBpMaster(this.queryParams.bpId).then(response => {
        this.allData.bpMaster = response.data;
      });
    },
    getBpMasterAddressList(){
      listBpMasterAddress().then(response =>{
        this.allData.bpMasterAddressList = response.rows;
      });
    },
    getList(){},


    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        bpId: null,
        ownerUserId: null,
        bpCode: null,
        bpName: null,
        extraNam: null,
        bpClass: null,
        bpCategory: null,
        bpType: null,
        bpTitle: null,
        searchTerm1: null,
        searchTerm2: null,
        externalBpCode: null,
        addressId: null,
        enabledFlag: "0",
        firstName: null,
        middleName: null,
        lastName: null,
        gender: null,
        nationality: null,
        dateOfBirth: null,
        placeOfBirth: null,
        nameAtBirth: null,
        maritalStatus: "0",
        numberOfChildren: null,
        academicBackground: null,
        age: null,
        idType: null,
        idCardNo: null,
        annualIncome: null,
        currency: null,
        capitalOfFamily: null,
        liabilityOfFamily: null,
        legalForm: null,
        industry: null,
        businessLicenseNum: null,
        corporateCode: null,
        organizationCode: null,
        taxRegistryNum: null,
        registeredPlace: null,
        foundedDate: null,
        registeredCapital: null,
        balanceSheetCurrency: null,
        taxpayerType: null,
        invoiceTitle: null,
        invoiceBpAddressPhoneNum: null,
        invoiceBpBankAccount: null,
        loanCardNum: null,
        paidUpCapital: null,
        companyNature: null,
        primaryBusiness: null,
        mainProducts: null,
        bpNameSp: null,
        genderSp: null,
        dateOfBirthSp: null,
        academicBackgroundSp: null,
        idTypeSp: null,
        idCardNoSp: null,
        countrySp: null,
        provinceSp: null,
        citySp: null,
        districtSp: null,
        addressSp: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        refV01: null,
        refV02: null,
        refV03: null,
        refV04: null,
        refV05: null,
        refV06: null,
        refV07: null,
        refV08: null,
        refV09: null,
        refV10: null,
        refV11: null,
        refV12: null,
        refV13: null,
        refV14: null,
        refV15: null,
        refN01: null,
        refN02: null,
        refN03: null,
        refN04: null,
        refN05: null,
        refN06: null,
        refN07: null,
        refN08: null,
        refN09: null,
        refN10: null,
        refD01: null,
        refD02: null,
        refD03: null,
        refD04: null,
        refD05: null,
        enterpriseScale: null,
        legalPerson: null,
        spousePhone: null,
        licenseTerms: null,
        porportionOfGuarantee: null,
        periodInJob: null,
        netMonthlyIncome: null,
        leaderFlag: null,
        mortgageFlag: null,
        localPersonFlag: null,
        highMentalFlag: null,
        hasHouseFlag: null,
        hasCarFlag: null,
        communityLeaderFlag: null,
        bankMatchFlag: null,
        housePropertyValue: null,
        houseLoanBalance: null,
        depositCertificate: null,
        creditCardLimit: null,
        addressOnId: null,
        addressOnResidentBooklit: null,
        livingAddress: null,
        workingPlace: null,
        workingDuration: null,
        workingAddress: null,
        operationYear: null,
        position: null,
        cellPhone: null,
        phoneExtra: null,
        phone: null,
        contactPerson: null,
        faxNumber: null,
        department: null,
        creditFlag: null,
        creditAmount: null,
        creditAlt: null,
        creditForbid: null,
        email: null,
        ncStatus: "0",
        cellPhone2: null,
        employeeAmount: null,
        billingStatus: "0",
        finNetCashInflow: null,
        finMonthlyPayment: null,
        finMonths: null,
        finLiquidityRatio: null,
        finLeverage: null,
        finData: null,
        finEvaluation: null,
        cddListId: null,
        pbNumber: null,
        repoNumber: null,
        finNote1: null,
        finNote: null,
        blackFlag: null,
        lockFlag: null,
        oldFlag: null,
        limitFrom: null,
        limitTo: null,
        lawBpFlag: null,
        finTurnover1: null,
        finTurnover: null,
        ifToZxFlag: null,
        zxLastUpdateDate: null,
        zxLastUpdatedBy: null,
        creditAmountUsedFix: null,
        creditAmountUsedCycle: null,
        creditAmountFrozenFix: null,
        creditAmountFrozenCycle: null,
        pollingTimes: null,
        saleType: null,
        assetType: null,
        area: null,
        listedCompanyFlag: null,
        marketLocation: null,
        creditRating: null,
        ratingDate: null,
        invoiceKind: null,
        licenseTermsIfLong: null,
        listedSubject: null,
        listedSubjectOrgCode: null,
        actualControllerIdType: null,
        actualControllerId: null,
        actualControllerOrgCode: null,
        bpNameSpClass: null,
        actualController: null,
        authorityRuleString: null,
        bankShortName: null,
        finOrgType: null,
        bankCode: null,
        enterpriseUnifiedCreditcode: null,
        startActiveDate: null,
        endActiveDate: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      //this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.bpId)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加商业伙伴信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const bpId = row.bpId || this.ids
      getBpMaster(bpId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改商业伙伴信息";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.bpId != null) {
            updateBpMaster(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addBpMaster(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const bpIds = row.bpId || this.ids;
      this.$modal.confirm('是否确认删除商业伙伴信息编号为"' + bpIds + '"的数据项？').then(function () {
        return delBpMaster(bpIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('lease/bpMaster/export', {
        ...this.queryParams
      }, `bpMaster_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
